/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   Module Name          : com.yaodian100.ec.generatepage.web.GenerateIdxBusterContentAction
   Module Description   :

   Date Created      : 2010/1/4
   Original Author   : feeling.wang
   Team              : yaodian100
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   MODIFICATION HISTORY
   ------------------------------------------------------------------------------
   Date Modified       Modified by       Comments
   ------------------------------------------------------------------------------
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
package com.yaodian100.ec.generatepage.web;

import java.io.File;
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Properties;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.time.FastDateFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Preparable;
import com.yaodian100.core.common.exception.CoreException;
import com.yaodian100.core.common.utils.DateUtil;
import com.yaodian100.ec.common.EcConstant;
import com.yaodian100.ec.generate.entity.EventImage;
import com.yaodian100.ec.generate.entity.GenerateAdvertise;
import com.yaodian100.ec.generate.entity.GenerateContent;
import com.yaodian100.ec.generate.entity.GeneratePosition;
import com.yaodian100.ec.generate.service.GenerateService;

/**
 * @author feeling.wang
 * 
 */
public class IdxPromotionAdvAction extends ActionSupport implements Preparable {

	private static final long serialVersionUID = -6589180605719180981L;
	/** logger */
	private final Logger logger = LoggerFactory.getLogger(IdxPromotionAdvAction.class);
	private GenerateService generateService;
	private GenerateAdvertise advertise;
	private GeneratePosition position;
	private GenerateContent content;
	private StringBuilder contents = null;
	private String advId;
	private String advName;
	private String advType = "IDX_SALE";
	private String advStatus;
	private String startDate;
	private String endDate;
	private String startTime;
	private String endTime;
	private String advTarget;
	private File tab1Img = null;
	private String tab1ImgName;
	private String tab1ImgLink;
	private String tab1ImgFolder;
	private String tab1Title;
	private String tab1ProdId1;
	private String tab1ProdId2;
	private String tab1ProdId3;
	private String tab1ProdId4;
	private File tab2Img = null;
	private String tab2ImgName;
	private String tab2ImgLink;
	private String tab2ImgFolder;
	private String tab2Title;
	private String tab2ProdId1;
	private String tab2ProdId2;
	private String tab2ProdId3;
	private String tab2ProdId4;
	private File tab3Img = null;
	private String tab3ImgName;
	private String tab3ImgLink;
	private String tab3ImgFolder;
	private String tab3Title;
	private String tab3ProdId1;
	private String tab3ProdId2;
	private String tab3ProdId3;
	private String tab3ProdId4;
	private File tab4Img = null;
	private String tab4ImgName;
	private String tab4ImgLink;
	private String tab4ImgFolder;
	private String tab4Title;
	private String tab4ProdId1;
	private String tab4ProdId2;
	private String tab4ProdId3;
	private String tab4ProdId4;

	private String tab1ImgadWord;
	private String tab2ImgadWord;
	private String tab3ImgadWord;
	private String tab4ImgadWord;
	private String tab1Prod1adWord;
	private String tab1Prod2adWord;
	private String tab1Prod3adWord;
	private String tab2Prod1adWord;
	private String tab2Prod2adWord;
	private String tab2Prod3adWord;
	private String tab3Prod1adWord;
	private String tab3Prod2adWord;
	private String tab3Prod3adWord;
	private String tab4Prod1adWord;
	private String tab4Prod2adWord;
	private String tab4Prod3adWord;

	private EventImage eventImage = null;
	private final String lineBreak = "\n";
	private final DateFormat PATTERN_DATE_FORMAT = new SimpleDateFormat(EcConstant.PATTERN_TIMESTAMP);

	/**
	 * 新增首页类别促销版位
	 * 
	 * @return
	 * @throws Exception
	 */
	public String addIdxPromotionAdv() throws Exception {
		initVariables();
		advId = "";
		return "editIdxPromotionAdv";
	}

	/**
	 * 新增首页类别促销版位_V2
	 * 
	 * @return
	 * @throws Exception
	 */
	public String addIdxPromotionAdv_V2() throws Exception {
		initVariables();
		advId = "";
		advType = "IDX_SALE_V2";
		return "editIdxPromotionAdv_V2";
	}

	/**
	 * 新增首页类别促销版位_V3
	 * 
	 * @return
	 * @throws Exception
	 */
	public String addIdxPromotionAdv_V3() throws Exception {
		initVariables();
		advId = "";
		advType = "IDX_SALE_V3";
		return "editIdxPromotionAdv_V3";
	}

	/**
	 * 编辑首页类别促销版位
	 * 
	 * @return
	 * @throws Exception
	 */
	public String editIdxPromotionAdv() throws Exception {
		initVariables();
		advertise = generateService.get(Long.parseLong(advId));
		position = generateService.getGeneratePositionByAdvId(Long.parseLong(advId)).get(0);
		content = generateService.getGenerateContentByAdvId(Long.parseLong(advId)).get(0);
		advStatus = advertise.getAdvStatus();
		advType = advertise.getAdvType();
		advName = advertise.getAdvName();
		advTarget = position.getAdvTarget();
		startDate = FastDateFormat.getInstance(EcConstant.PATTERN_DATE).format(advertise.getStartDate());
		endDate = FastDateFormat.getInstance(EcConstant.PATTERN_DATE).format(advertise.getEndDate());
		readPropertise(content);
		return "editIdxPromotionAdv";
	}

	/**
	 * 编辑首页类别促销版位_V2
	 * 
	 * @return
	 * @throws Exception
	 */
	public String editIdxPromotionAdv_V2() throws Exception {
		initVariables();
		advertise = generateService.get(Long.parseLong(advId));
		position = generateService.getGeneratePositionByAdvId(Long.parseLong(advId)).get(0);
		content = generateService.getGenerateContentByAdvId(Long.parseLong(advId)).get(0);
		advStatus = advertise.getAdvStatus();
		advType = advertise.getAdvType();
		advName = advertise.getAdvName();
		advTarget = position.getAdvTarget();
		startDate = FastDateFormat.getInstance(EcConstant.PATTERN_DATE).format(advertise.getStartDate());
		endDate = FastDateFormat.getInstance(EcConstant.PATTERN_DATE).format(advertise.getEndDate());
		startTime = FastDateFormat.getInstance("HH:mm").format(advertise.getStartDate());
		endTime = FastDateFormat.getInstance("HH:mm").format(advertise.getEndDate());
		readPropertise_V2(content);
		return "editIdxPromotionAdv_V2";
	}

	/**
	 * 编辑首页类别促销版位_V3
	 * 
	 * @return
	 * @throws Exception
	 */
	public String editIdxPromotionAdv_V3() throws Exception {
		initVariables();
		advertise = generateService.get(Long.parseLong(advId));
		position = generateService.getGeneratePositionByAdvId(Long.parseLong(advId)).get(0);
		content = generateService.getGenerateContentByAdvId(Long.parseLong(advId)).get(0);
		advStatus = advertise.getAdvStatus();
		advType = advertise.getAdvType();
		advName = advertise.getAdvName();
		advTarget = position.getAdvTarget();
		startDate = FastDateFormat.getInstance(EcConstant.PATTERN_DATE).format(advertise.getStartDate());
		endDate = FastDateFormat.getInstance(EcConstant.PATTERN_DATE).format(advertise.getEndDate());
		startTime = FastDateFormat.getInstance("HH:mm").format(advertise.getStartDate());
		endTime = FastDateFormat.getInstance("HH:mm").format(advertise.getEndDate());
		readPropertise_V2(content);
		return "editIdxPromotionAdv_V3";
	}

	public GenerateAdvertise getAdvertise() {
		return advertise;
	}

	public String getAdvId() {
		return advId;
	}

	public String getAdvName() {
		return advName;
	}

	public String getAdvStatus() {
		return advStatus;
	}

	public String getAdvTarget() {
		return advTarget;
	}

	public String getAdvType() {
		return advType;
	}

	public GenerateContent getContent() {
		return content;
	}

	public String getEndDate() {
		return endDate;
	}

	public String getEndTime() {
		return endTime;
	}

	public GeneratePosition getPosition() {
		return position;
	}

	public String getStartDate() {
		return startDate;
	}

	public String getStartTime() {
		return startTime;
	}

	public File getTab1Img() {
		return tab1Img;
	}

	public String getTab1ImgFolder() {
		return tab1ImgFolder;
	}

	public String getTab1ImgLink() {
		return tab1ImgLink;
	}

	public String getTab1ImgName() {
		return tab1ImgName;
	}

	public String getTab1ProdId1() {
		return tab1ProdId1;
	}

	public String getTab1ProdId2() {
		return tab1ProdId2;
	}

	public String getTab1ProdId3() {
		return tab1ProdId3;
	}

	public String getTab1ProdId4() {
		return tab1ProdId4;
	}

	public String getTab1Title() {
		return tab1Title;
	}

	public File getTab2Img() {
		return tab2Img;
	}

	public String getTab2ImgFolder() {
		return tab2ImgFolder;
	}

	public String getTab2ImgLink() {
		return tab2ImgLink;
	}

	public String getTab2ImgName() {
		return tab2ImgName;
	}

	public String getTab2ProdId1() {
		return tab2ProdId1;
	}

	public String getTab2ProdId2() {
		return tab2ProdId2;
	}

	public String getTab2ProdId3() {
		return tab2ProdId3;
	}

	public String getTab2ProdId4() {
		return tab2ProdId4;
	}

	public String getTab2Title() {
		return tab2Title;
	}

	public File getTab3Img() {
		return tab3Img;
	}

	public String getTab3ImgFolder() {
		return tab3ImgFolder;
	}

	public String getTab3ImgLink() {
		return tab3ImgLink;
	}

	public String getTab3ImgName() {
		return tab3ImgName;
	}

	public String getTab3ProdId1() {
		return tab3ProdId1;
	}

	public String getTab3ProdId2() {
		return tab3ProdId2;
	}

	public String getTab3ProdId3() {
		return tab3ProdId3;
	}

	public String getTab3ProdId4() {
		return tab3ProdId4;
	}

	public String getTab3Title() {
		return tab3Title;
	}

	public File getTab4Img() {
		return tab4Img;
	}

	public String getTab4ImgFolder() {
		return tab4ImgFolder;
	}

	public String getTab4ImgLink() {
		return tab4ImgLink;
	}

	public String getTab4ImgName() {
		return tab4ImgName;
	}

	public String getTab4ProdId1() {
		return tab4ProdId1;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.opensymphony.xwork2.Preparable#prepare()
	 */

	public String getTab4ProdId2() {
		return tab4ProdId2;
	}

	public String getTab4ProdId3() {
		return tab4ProdId3;
	}

	public String getTab4ProdId4() {
		return tab4ProdId4;
	}

	public String getTab4Title() {
		return tab4Title;
	}

	private boolean idxPromotionAdvValidate() throws CoreException, ParseException, IOException {
		/**************************** 必填栏位 ****************************/
		if (StringUtils.isBlank(advName)) {
			addFieldError("advName", "请输入广告名称");
		}

		if (StringUtils.isBlank(startDate)) {
			addFieldError("startDate", "请输入起始日期");
		}

		if (StringUtils.isBlank(endDate)) {
			addFieldError("endDate", "请输入结束日期");
		}

		if (StringUtils.isBlank(advTarget)) {
			addFieldError("advTarget", "请选择位置");
		}

		if (StringUtils.isBlank(tab1ImgName)) {
			addFieldError("tab1ImgName", "請輸入tab1 img name");
		}

		if (StringUtils.isBlank(tab1ImgLink)) {
			addFieldError("tab1ImgLink", "請輸入tab1 img link");
		}

		if (StringUtils.isBlank(tab1Title)) {
			addFieldError("tab1Title", "請輸入tab1 title");
		}

		if (StringUtils.isBlank(tab2ImgName)) {
			addFieldError("tab2ImgName", "請輸入tab2 img name");
		}

		if (StringUtils.isBlank(tab2ImgLink)) {
			addFieldError("tab2ImgLink", "請輸入tab2 img link");
		}

		if (StringUtils.isBlank(tab2Title)) {
			addFieldError("tab2Title", "請輸入tab2 title");
		}

		if (StringUtils.isBlank(tab3ImgName)) {
			addFieldError("tab3ImgName", "請輸入tab3 img name");
		}

		if (StringUtils.isBlank(tab3ImgLink)) {
			addFieldError("tab3ImgLink", "請輸入tab3 img link");
		}

		if (StringUtils.isBlank(tab3Title)) {
			addFieldError("tab3Title", "請輸入tab3 title");
		}

		if (StringUtils.isBlank(tab4ImgName)) {
			addFieldError("tab4ImgName", "請輸入tab4 img name");
		}

		if (StringUtils.isBlank(tab4ImgLink)) {
			addFieldError("tab4ImgLink", "請輸入tab4 img link");
		}

		if (StringUtils.isBlank(tab4Title)) {
			addFieldError("tab4Title", "請輸入tab4 title");
		}

		if (StringUtils.isBlank(tab1ProdId1)) {
			addFieldError("tab1ProdId1", "請輸入tab1 ProdId1");
		} else if (!generateService.isProductExist(tab1ProdId1)) {
			addFieldError("tab1ProdId1", "tab1商品1可能不存在，或是已被删除，或是不在架上");
		}

		if (StringUtils.isBlank(tab1ProdId2)) {
			addFieldError("tab1ProdId2", "請輸入tab1 ProdId2");
		} else if (!generateService.isProductExist(tab1ProdId2)) {
			addFieldError("tab1ProdId2", "tab1商品2可能不存在，或是已被删除，或是不在架上");
		}

		if (StringUtils.isBlank(tab1ProdId3)) {
			addFieldError("tab1ProdId3", "請輸入tab1 ProdId3");
		} else if (!generateService.isProductExist(tab1ProdId3)) {
			addFieldError("tab1ProdId3", "tab1商品3可能不存在，或是已被删除，或是不在架上");
		}

		if (StringUtils.isBlank(tab2ProdId1)) {
			addFieldError("tab2ProdId1", "請輸入tab2 ProdId1");
		} else if (!generateService.isProductExist(tab2ProdId1)) {
			addFieldError("tab2ProdId1", "tab2商品1可能不存在，或是已被删除，或是不在架上");
		}

		if (StringUtils.isBlank(tab2ProdId2)) {
			addFieldError("tab2ProdId2", "請輸入tab2 ProdId2");
		} else if (!generateService.isProductExist(tab2ProdId2)) {
			addFieldError("tab2ProdId2", "tab2商品2可能不存在，或是已被删除，或是不在架上");
		}

		if (StringUtils.isBlank(tab2ProdId3)) {
			addFieldError("tab2ProdId3", "請輸入tab2 ProdId3");
		} else if (!generateService.isProductExist(tab2ProdId3)) {
			addFieldError("tab2ProdId3", "tab2商品3可能不存在，或是已被删除，或是不在架上");
		}

		if (StringUtils.isBlank(tab3ProdId1)) {
			addFieldError("tab3ProdId1", "請輸入tab3 ProdId1");
		} else if (!generateService.isProductExist(tab3ProdId1)) {
			addFieldError("tab3ProdId1", "tab3商品1可能不存在，或是已被删除，或是不在架上");
		}

		if (StringUtils.isBlank(tab3ProdId2)) {
			addFieldError("tab3ProdId2", "請輸入tab3 ProdId2");
		} else if (!generateService.isProductExist(tab3ProdId2)) {
			addFieldError("tab3ProdId2", "tab3商品2可能不存在，或是已被删除，或是不在架上");
		}

		if (StringUtils.isBlank(tab3ProdId3)) {
			addFieldError("tab3ProdId3", "請輸入tab3 ProdId3");
		} else if (!generateService.isProductExist(tab3ProdId3)) {
			addFieldError("tab3ProdId3", "tab3商品3可能不存在，或是已被删除，或是不在架上");
		}

		if (StringUtils.isBlank(tab4ProdId1)) {
			addFieldError("tab4ProdId1", "請輸入tab4 ProdId1");
		} else if (!generateService.isProductExist(tab4ProdId1)) {
			addFieldError("tab4ProdId1", "tab4商品1可能不存在，或是已被删除，或是不在架上");
		}

		if (StringUtils.isBlank(tab4ProdId2)) {
			addFieldError("tab4ProdId2", "請輸入tab4 ProdId2");
		} else if (!generateService.isProductExist(tab4ProdId2)) {
			addFieldError("tab4ProdId2", "tab4商品2可能不存在，或是已被删除，或是不在架上");
		}

		if (StringUtils.isBlank(tab4ProdId3)) {
			addFieldError("tab4ProdId3", "請輸入tab4 ProdId3");
		} else if (!generateService.isProductExist(tab4ProdId3)) {
			addFieldError("tab4ProdId3", "tab4商品3可能不存在，或是已被删除，或是不在架上");
		}

		if (getFieldErrors().isEmpty()) {
			return true;
		} else {
			return false;
		}
	}

	/**
	 * 初始化变数值
	 */
	void initVariables() {
		advertise = new GenerateAdvertise();
		position = new GeneratePosition();
		content = new GenerateContent();
		tab1Img = null;
		tab1ImgName = "";
		tab1ImgLink = "";
		tab1ImgFolder = "";
		tab1Title = "";
		tab1ProdId1 = "";
		tab1ProdId2 = "";
		tab1ProdId3 = "";
		tab1ProdId4 = "";
		tab2Img = null;
		tab2ImgName = "";
		tab2ImgLink = "";
		tab2ImgFolder = "";
		tab2Title = "";
		tab2ProdId1 = "";
		tab2ProdId2 = "";
		tab2ProdId3 = "";
		tab2ProdId4 = "";
		tab3Img = null;
		tab3ImgName = "";
		tab3ImgLink = "";
		tab3ImgFolder = "";
		tab3Title = "";
		tab3ProdId1 = "";
		tab3ProdId2 = "";
		tab3ProdId3 = "";
		tab3ProdId4 = "";
		tab4Img = null;
		tab4ImgName = "";
		tab4ImgLink = "";
		tab4ImgFolder = "";
		tab4Title = "";
		tab4ProdId1 = "";
		tab4ProdId2 = "";
		tab4ProdId3 = "";
		tab4ProdId4 = "";
		startDate = "";
		endDate = "";
		startTime = "";
		endTime = "";
	}

	public void prepare() throws Exception {
		clearErrorsAndMessages();
	}

	/**
	 * 從db讀取propertise資料
	 * 
	 * @param content
	 * @throws IOException
	 */
	void readPropertise(GenerateContent content) throws IOException {
		Properties prop = new Properties();
		Reader reader = new StringReader(content.getContents());
		prop.load(reader);
		reader.close();
		tab1ImgName = StringUtils.defaultString(prop.get("tab1ImgName").toString(), "");
		tab1ImgLink = StringUtils.defaultString(prop.get("tab1ImgLink").toString(), "");
		tab1ImgFolder = StringUtils.defaultString(prop.get("tab1ImgFolder").toString(), "");
		tab1Title = StringUtils.defaultString(prop.get("tab1Title").toString(), "");
		tab1ProdId1 = StringUtils.defaultString(prop.get("tab1ProdId1").toString(), "");
		tab1ProdId2 = StringUtils.defaultString(prop.get("tab1ProdId2").toString(), "");
		tab1ProdId3 = StringUtils.defaultString(prop.get("tab1ProdId3").toString(), "");
		tab1ProdId4 = StringUtils.defaultString(prop.get("tab1ProdId4").toString(), "");

		tab2ImgName = StringUtils.defaultString(prop.get("tab2ImgName").toString(), "");
		tab2ImgLink = StringUtils.defaultString(prop.get("tab2ImgLink").toString(), "");
		tab2ImgFolder = StringUtils.defaultString(prop.get("tab2ImgFolder").toString(), "");
		tab2Title = StringUtils.defaultString(prop.get("tab2Title").toString(), "");
		tab2ProdId1 = StringUtils.defaultString(prop.get("tab2ProdId1").toString(), "");
		tab2ProdId2 = StringUtils.defaultString(prop.get("tab2ProdId2").toString(), "");
		tab2ProdId3 = StringUtils.defaultString(prop.get("tab2ProdId3").toString(), "");
		tab2ProdId4 = StringUtils.defaultString(prop.get("tab2ProdId4").toString(), "");

		tab3ImgName = StringUtils.defaultString(prop.get("tab3ImgName").toString(), "");
		tab3ImgLink = StringUtils.defaultString(prop.get("tab3ImgLink").toString(), "");
		tab3ImgFolder = StringUtils.defaultString(prop.get("tab3ImgFolder").toString(), "");
		tab3Title = StringUtils.defaultString(prop.get("tab3Title").toString(), "");
		tab3ProdId1 = StringUtils.defaultString(prop.get("tab3ProdId1").toString(), "");
		tab3ProdId2 = StringUtils.defaultString(prop.get("tab3ProdId2").toString(), "");
		tab3ProdId3 = StringUtils.defaultString(prop.get("tab3ProdId3").toString(), "");
		tab3ProdId4 = StringUtils.defaultString(prop.get("tab3ProdId4").toString(), "");

		tab4ImgName = StringUtils.defaultString(prop.get("tab4ImgName").toString(), "");
		tab4ImgLink = StringUtils.defaultString(prop.get("tab4ImgLink").toString(), "");
		tab4ImgFolder = StringUtils.defaultString(prop.get("tab4ImgFolder").toString(), "");
		tab4Title = StringUtils.defaultString(prop.get("tab4Title").toString(), "");
		tab4ProdId1 = StringUtils.defaultString(prop.get("tab4ProdId1").toString(), "");
		tab4ProdId2 = StringUtils.defaultString(prop.get("tab4ProdId2").toString(), "");
		tab4ProdId3 = StringUtils.defaultString(prop.get("tab4ProdId3").toString(), "");
		tab4ProdId4 = StringUtils.defaultString(prop.get("tab4ProdId4").toString(), "");
	}

	/**
	 * 從db讀取propertise資料
	 * 
	 * @param content
	 * @throws IOException
	 */
	void readPropertise_V2(GenerateContent content) throws IOException {
		Properties prop = new Properties();
		Reader reader = new StringReader(content.getContents());
		prop.load(reader);
		reader.close();
		tab1ImgName = StringUtils.defaultString(prop.get("tab1ImgName").toString(), "");
		tab1ImgLink = StringUtils.defaultString(prop.get("tab1ImgLink").toString(), "");
		tab1ImgFolder = StringUtils.defaultString(prop.get("tab1ImgFolder").toString(), "");
		tab1Title = StringUtils.defaultString(prop.get("tab1Title").toString(), "");
		tab1ProdId1 = StringUtils.defaultString(prop.get("tab1ProdId1").toString(), "");
		tab1ProdId2 = StringUtils.defaultString(prop.get("tab1ProdId2").toString(), "");
		tab1ProdId3 = StringUtils.defaultString(prop.get("tab1ProdId3").toString(), "");

		tab2ImgName = StringUtils.defaultString(prop.get("tab2ImgName").toString(), "");
		tab2ImgLink = StringUtils.defaultString(prop.get("tab2ImgLink").toString(), "");
		tab2ImgFolder = StringUtils.defaultString(prop.get("tab2ImgFolder").toString(), "");
		tab2Title = StringUtils.defaultString(prop.get("tab2Title").toString(), "");
		tab2ProdId1 = StringUtils.defaultString(prop.get("tab2ProdId1").toString(), "");
		tab2ProdId2 = StringUtils.defaultString(prop.get("tab2ProdId2").toString(), "");
		tab2ProdId3 = StringUtils.defaultString(prop.get("tab2ProdId3").toString(), "");

		tab3ImgName = StringUtils.defaultString(prop.get("tab3ImgName").toString(), "");
		tab3ImgLink = StringUtils.defaultString(prop.get("tab3ImgLink").toString(), "");
		tab3ImgFolder = StringUtils.defaultString(prop.get("tab3ImgFolder").toString(), "");
		tab3Title = StringUtils.defaultString(prop.get("tab3Title").toString(), "");
		tab3ProdId1 = StringUtils.defaultString(prop.get("tab3ProdId1").toString(), "");
		tab3ProdId2 = StringUtils.defaultString(prop.get("tab3ProdId2").toString(), "");
		tab3ProdId3 = StringUtils.defaultString(prop.get("tab3ProdId3").toString(), "");

		tab4ImgName = StringUtils.defaultString(prop.get("tab4ImgName").toString(), "");
		tab4ImgLink = StringUtils.defaultString(prop.get("tab4ImgLink").toString(), "");
		tab4ImgFolder = StringUtils.defaultString(prop.get("tab4ImgFolder").toString(), "");
		tab4Title = StringUtils.defaultString(prop.get("tab4Title").toString(), "");
		tab4ProdId1 = StringUtils.defaultString(prop.get("tab4ProdId1").toString(), "");
		tab4ProdId2 = StringUtils.defaultString(prop.get("tab4ProdId2").toString(), "");
		tab4ProdId3 = StringUtils.defaultString(prop.get("tab4ProdId3").toString(), "");
		if ("IDX_SALE_V3".equals(advType)) {
			readPropertise_V3(prop);
		}
	}

	/**
	 * 從db讀取propertise資料
	 * 
	 * @param content
	 * @throws IOException
	 */
	void readPropertise_V3(Properties prop) throws IOException {
		tab1ImgadWord = StringUtils.defaultString(prop.get("tab1ImgadWord").toString(), "");
		tab2ImgadWord = StringUtils.defaultString(prop.get("tab2ImgadWord").toString(), "");
		tab3ImgadWord = StringUtils.defaultString(prop.get("tab3ImgadWord").toString(), "");
		tab4ImgadWord = StringUtils.defaultString(prop.get("tab4ImgadWord").toString(), "");
		tab1Prod1adWord = StringUtils.defaultString(prop.get("tab1Prod1adWord").toString(), "");
		tab1Prod2adWord = StringUtils.defaultString(prop.get("tab1Prod2adWord").toString(), "");
		tab1Prod3adWord = StringUtils.defaultString(prop.get("tab1Prod3adWord").toString(), "");
		tab2Prod1adWord = StringUtils.defaultString(prop.get("tab2Prod1adWord").toString(), "");
		tab2Prod2adWord = StringUtils.defaultString(prop.get("tab2Prod2adWord").toString(), "");
		tab2Prod3adWord = StringUtils.defaultString(prop.get("tab2Prod3adWord").toString(), "");
		tab3Prod1adWord = StringUtils.defaultString(prop.get("tab3Prod1adWord").toString(), "");
		tab3Prod2adWord = StringUtils.defaultString(prop.get("tab3Prod2adWord").toString(), "");
		tab3Prod3adWord = StringUtils.defaultString(prop.get("tab3Prod3adWord").toString(), "");
		tab4Prod1adWord = StringUtils.defaultString(prop.get("tab4Prod1adWord").toString(), "");
		tab4Prod2adWord = StringUtils.defaultString(prop.get("tab4Prod2adWord").toString(), "");
		tab4Prod3adWord = StringUtils.defaultString(prop.get("tab4Prod3adWord").toString(), "");
	}

	/**
	 * 新增/修改首页类别促销版位
	 * 
	 * @return
	 * @throws Exception
	 */
	public String saveIdxPromotionAdv() throws Exception {
		boolean result = false;
		if (idxPromotionAdvValidate()) {
			contents = new StringBuilder("");
			String today = FastDateFormat.getInstance(EcConstant.DEFAULT_PATTERN_DATE).format(DateUtil.getToday().getTime());
			// upload file
			if (GenerateHelper.mkDir(advType)) {
				if (StringUtils.isBlank(advId)) {// add
					eventImage = saveImgFile(tab1Img, tab1ImgName, advType);
					if (null != eventImage) {
						contents.append("tab1ImgName=").append(eventImage.getUuid()).append(eventImage.getImgType()).append(
								lineBreak);
						contents.append("tab1ImgFolder=").append(today).append(lineBreak);
					}

					eventImage = saveImgFile(tab2Img, tab2ImgName, advType);
					if (null != eventImage) {
						contents.append("tab2ImgName=").append(eventImage.getUuid()).append(eventImage.getImgType()).append(
								lineBreak);
						contents.append("tab2ImgFolder=").append(today).append(lineBreak);
					}

					eventImage = saveImgFile(tab3Img, tab3ImgName, advType);
					if (null != eventImage) {
						contents.append("tab3ImgName=").append(eventImage.getUuid()).append(eventImage.getImgType()).append(
								lineBreak);
						contents.append("tab3ImgFolder=").append(today).append(lineBreak);
					}

					eventImage = saveImgFile(tab4Img, tab4ImgName, advType);
					if (null != eventImage) {
						contents.append("tab4ImgName=").append(eventImage.getUuid()).append(eventImage.getImgType()).append(
								lineBreak).append("tab4ImgFolder=").append(today).append(lineBreak);
					}
				} else {// update
					if (null == tab1Img) {
						contents.append("tab1ImgName=").append(tab1ImgName).append(lineBreak);
						contents.append("tab1ImgFolder=").append(tab1ImgFolder).append(lineBreak);
					} else {
						eventImage = saveImgFile(tab1Img, tab1ImgName, advType);
						if (null != eventImage) {
							contents.append("tab1ImgName=").append(eventImage.getUuid()).append(eventImage.getImgType()).append(
									lineBreak);
							contents.append("tab1ImgFolder=").append(today).append(lineBreak);
						}
					}

					if (null == tab2Img) {
						contents.append("tab2ImgName=").append(tab2ImgName).append(lineBreak);
						contents.append("tab2ImgFolder=").append(tab2ImgFolder).append(lineBreak);
					} else {
						eventImage = saveImgFile(tab2Img, tab2ImgName, advType);
						if (null != eventImage) {
							contents.append("tab2ImgName=").append(eventImage.getUuid()).append(eventImage.getImgType()).append(
									lineBreak);
							contents.append("tab2ImgFolder=").append(today).append(lineBreak);
						}
					}
					if (null == tab3Img) {
						contents.append("tab3ImgName=").append(tab3ImgName).append(lineBreak);
						contents.append("tab3ImgFolder=").append(tab3ImgFolder).append(lineBreak);
					} else {
						eventImage = saveImgFile(tab3Img, tab3ImgName, advType);
						if (null != eventImage) {
							contents.append("tab3ImgName=").append(eventImage.getUuid()).append(eventImage.getImgType()).append(
									lineBreak);
							contents.append("tab3ImgFolder=").append(today).append(lineBreak);
						}
					}
					if (null == tab4Img) {
						contents.append("tab4ImgName=").append(tab4ImgName).append(lineBreak);
						contents.append("tab4ImgFolder=").append(tab4ImgFolder).append(lineBreak);
					} else {
						eventImage = saveImgFile(tab4Img, tab4ImgName, advType);
						if (null != eventImage) {
							contents.append("tab4ImgName=").append(eventImage.getUuid()).append(eventImage.getImgType()).append(
									lineBreak);
							contents.append("tab4ImgFolder=").append(today).append(lineBreak);
						}
					}
				}
				contents.append("tab1ImgLink=").append(tab1ImgLink).append(lineBreak);
				contents.append("tab1Title=").append(tab1Title).append(lineBreak);
				contents.append("tab1ProdId1=").append(tab1ProdId1).append(lineBreak);
				contents.append("tab1ProdId2=").append(tab1ProdId2).append(lineBreak);
				contents.append("tab1ProdId3=").append(tab1ProdId3).append(lineBreak);
				contents.append("tab1ProdId4=").append(tab1ProdId4).append(lineBreak);

				contents.append("tab2ImgLink=").append(tab2ImgLink).append(lineBreak);
				contents.append("tab2Title=").append(tab2Title).append(lineBreak);
				contents.append("tab2ProdId1=").append(tab2ProdId1).append(lineBreak);
				contents.append("tab2ProdId2=").append(tab2ProdId2).append(lineBreak);
				contents.append("tab2ProdId3=").append(tab2ProdId3).append(lineBreak);
				contents.append("tab2ProdId4=").append(tab2ProdId4).append(lineBreak);

				contents.append("tab3ImgLink=").append(tab3ImgLink).append(lineBreak);
				contents.append("tab1Title=").append(tab1Title).append(lineBreak);
				contents.append("tab3Title=").append(tab3Title).append(lineBreak);
				contents.append("tab3ProdId1=").append(tab3ProdId1).append(lineBreak);
				contents.append("tab3ProdId2=").append(tab3ProdId2).append(lineBreak);
				contents.append("tab3ProdId3=").append(tab3ProdId3).append(lineBreak);
				contents.append("tab3ProdId4=").append(tab3ProdId4).append(lineBreak);

				contents.append("tab4ImgLink=").append(tab4ImgLink).append(lineBreak);
				contents.append("tab4Title=").append(tab4Title).append(lineBreak);
				contents.append("tab4ProdId1=").append(tab4ProdId1).append(lineBreak);
				contents.append("tab4ProdId2=").append(tab4ProdId2).append(lineBreak);
				contents.append("tab4ProdId3=").append(tab4ProdId3).append(lineBreak);
				contents.append("tab4ProdId4=").append(tab4ProdId4).append(lineBreak);

				if (StringUtils.isBlank(advId)) {
					advertise = new GenerateAdvertise();
					position = new GeneratePosition();
					content = new GenerateContent();
				} else {
					advertise = generateService.get(Long.parseLong(advId));
					position = generateService.getGeneratePositionByAdvId(Long.parseLong(advId)).get(0);
					content = generateService.getGenerateContentByAdvId(Long.parseLong(advId)).get(0);
				}
				// set advertise
				advertise.setAdvType(advType);
				advertise.setAdvName(advName.trim());
				advertise.setStartDate(EcConstant.PATTERN_DATE_FORMAT.parse(startDate));
				advertise.setEndDate(EcConstant.PATTERN_DATE_FORMAT.parse(endDate));
				advertise.setAdvStatus(advStatus);
				position.setAdvTarget(advTarget);
				content.setContents(contents.toString());
				if (StringUtils.countMatches(content.getContents(), "ImgName") == 4) {
					if (StringUtils.isBlank(advId)) {
						result = generateService.saveGenerateCombine(advertise, position, content);
					} else {
						result = generateService.updateGenerateCombine(advertise, position, content);
					}
				} else {
					result = false;
				}
				contents.setLength(0);
				if (!result) {
					return "editIdxPromotionAdv";
				} else {
					return "listIdxAdv";
				}
			}
		}
		return "editIdxPromotionAdv";
	}

	/**
	 * 新增/修改首页类别促销版位_V2
	 * 
	 * @return
	 * @throws Exception
	 */
	public String saveIdxPromotionAdv_V2() throws Exception {
		boolean result = false;
		if (idxPromotionAdvValidate()) {
			contents = new StringBuilder("");
			String today = FastDateFormat.getInstance(EcConstant.DEFAULT_PATTERN_DATE).format(DateUtil.getToday().getTime());
			// upload file
			if (GenerateHelper.mkDir(advType)) {
				if (StringUtils.isBlank(advId)) {// add
					eventImage = saveImgFile(tab1Img, tab1ImgName, advType);
					if (null != eventImage) {
						contents.append("tab1ImgName=").append(eventImage.getUuid()).append(eventImage.getImgType()).append(
								lineBreak);
						contents.append("tab1ImgFolder=").append(today).append(lineBreak);
					}

					eventImage = saveImgFile(tab2Img, tab2ImgName, advType);
					if (null != eventImage) {
						contents.append("tab2ImgName=").append(eventImage.getUuid()).append(eventImage.getImgType()).append(
								lineBreak);
						contents.append("tab2ImgFolder=").append(today).append(lineBreak);
					}

					eventImage = saveImgFile(tab3Img, tab3ImgName, advType);
					if (null != eventImage) {
						contents.append("tab3ImgName=").append(eventImage.getUuid()).append(eventImage.getImgType()).append(
								lineBreak);
						contents.append("tab3ImgFolder=").append(today).append(lineBreak);
					}

					eventImage = saveImgFile(tab4Img, tab4ImgName, advType);
					if (null != eventImage) {
						contents.append("tab4ImgName=").append(eventImage.getUuid()).append(eventImage.getImgType()).append(
								lineBreak).append("tab4ImgFolder=").append(today).append(lineBreak);
					}
				} else {// update
					if (null == tab1Img) {
						contents.append("tab1ImgName=").append(tab1ImgName).append(lineBreak);
						contents.append("tab1ImgFolder=").append(tab1ImgFolder).append(lineBreak);
					} else {
						eventImage = saveImgFile(tab1Img, tab1ImgName, advType);
						if (null != eventImage) {
							contents.append("tab1ImgName=").append(eventImage.getUuid()).append(eventImage.getImgType()).append(
									lineBreak);
							contents.append("tab1ImgFolder=").append(today).append(lineBreak);
						}
					}

					if (null == tab2Img) {
						contents.append("tab2ImgName=").append(tab2ImgName).append(lineBreak);
						contents.append("tab2ImgFolder=").append(tab2ImgFolder).append(lineBreak);
					} else {
						eventImage = saveImgFile(tab2Img, tab2ImgName, advType);
						if (null != eventImage) {
							contents.append("tab2ImgName=").append(eventImage.getUuid()).append(eventImage.getImgType()).append(
									lineBreak);
							contents.append("tab2ImgFolder=").append(today).append(lineBreak);
						}
					}
					if (null == tab3Img) {
						contents.append("tab3ImgName=").append(tab3ImgName).append(lineBreak);
						contents.append("tab3ImgFolder=").append(tab3ImgFolder).append(lineBreak);
					} else {
						eventImage = saveImgFile(tab3Img, tab3ImgName, advType);
						if (null != eventImage) {
							contents.append("tab3ImgName=").append(eventImage.getUuid()).append(eventImage.getImgType()).append(
									lineBreak);
							contents.append("tab3ImgFolder=").append(today).append(lineBreak);
						}
					}
					if (null == tab4Img) {
						contents.append("tab4ImgName=").append(tab4ImgName).append(lineBreak);
						contents.append("tab4ImgFolder=").append(tab4ImgFolder).append(lineBreak);
					} else {
						eventImage = saveImgFile(tab4Img, tab4ImgName, advType);
						if (null != eventImage) {
							contents.append("tab4ImgName=").append(eventImage.getUuid()).append(eventImage.getImgType()).append(
									lineBreak);
							contents.append("tab4ImgFolder=").append(today).append(lineBreak);
						}
					}
				}
				contents.append("tab1ImgLink=").append(tab1ImgLink).append(lineBreak);
				contents.append("tab1Title=").append(tab1Title).append(lineBreak);
				contents.append("tab1ProdId1=").append(tab1ProdId1).append(lineBreak);
				contents.append("tab1ProdId2=").append(tab1ProdId2).append(lineBreak);
				contents.append("tab1ProdId3=").append(tab1ProdId3).append(lineBreak);

				contents.append("tab2ImgLink=").append(tab2ImgLink).append(lineBreak);
				contents.append("tab2Title=").append(tab2Title).append(lineBreak);
				contents.append("tab2ProdId1=").append(tab2ProdId1).append(lineBreak);
				contents.append("tab2ProdId2=").append(tab2ProdId2).append(lineBreak);
				contents.append("tab2ProdId3=").append(tab2ProdId3).append(lineBreak);

				contents.append("tab3ImgLink=").append(tab3ImgLink).append(lineBreak);
				contents.append("tab1Title=").append(tab1Title).append(lineBreak);
				contents.append("tab3Title=").append(tab3Title).append(lineBreak);
				contents.append("tab3ProdId1=").append(tab3ProdId1).append(lineBreak);
				contents.append("tab3ProdId2=").append(tab3ProdId2).append(lineBreak);
				contents.append("tab3ProdId3=").append(tab3ProdId3).append(lineBreak);

				contents.append("tab4ImgLink=").append(tab4ImgLink).append(lineBreak);
				contents.append("tab4Title=").append(tab4Title).append(lineBreak);
				contents.append("tab4ProdId1=").append(tab4ProdId1).append(lineBreak);
				contents.append("tab4ProdId2=").append(tab4ProdId2).append(lineBreak);
				contents.append("tab4ProdId3=").append(tab4ProdId3).append(lineBreak);

				contents.append("tab1ImgadWord=").append(tab1ImgadWord).append(lineBreak);
				contents.append("tab2ImgadWord=").append(tab2ImgadWord).append(lineBreak);
				contents.append("tab3ImgadWord=").append(tab3ImgadWord).append(lineBreak);
				contents.append("tab4ImgadWord=").append(tab4ImgadWord).append(lineBreak);

				contents.append("tab1Prod1adWord=").append(tab1Prod1adWord).append(lineBreak);
				contents.append("tab1Prod2adWord=").append(tab1Prod2adWord).append(lineBreak);
				contents.append("tab1Prod3adWord=").append(tab1Prod3adWord).append(lineBreak);
				contents.append("tab2Prod1adWord=").append(tab2Prod1adWord).append(lineBreak);
				contents.append("tab2Prod2adWord=").append(tab2Prod2adWord).append(lineBreak);
				contents.append("tab2Prod3adWord=").append(tab2Prod3adWord).append(lineBreak);
				contents.append("tab3Prod1adWord=").append(tab3Prod1adWord).append(lineBreak);
				contents.append("tab3Prod2adWord=").append(tab3Prod2adWord).append(lineBreak);
				contents.append("tab3Prod3adWord=").append(tab3Prod3adWord).append(lineBreak);
				contents.append("tab4Prod1adWord=").append(tab4Prod1adWord).append(lineBreak);
				contents.append("tab4Prod2adWord=").append(tab4Prod2adWord).append(lineBreak);
				contents.append("tab4Prod3adWord=").append(tab4Prod3adWord).append(lineBreak);

				if (StringUtils.isBlank(advId)) {
					advertise = new GenerateAdvertise();
					position = new GeneratePosition();
					content = new GenerateContent();
				} else {
					advertise = generateService.get(Long.parseLong(advId));
					position = generateService.getGeneratePositionByAdvId(Long.parseLong(advId)).get(0);
					content = generateService.getGenerateContentByAdvId(Long.parseLong(advId)).get(0);
				}
				// set advertise
				advertise.setAdvType(advType);
				advertise.setAdvName(advName.trim());
				advertise.setStartDate(PATTERN_DATE_FORMAT.parse(startDate + " " + startTime + ":00"));
				advertise.setEndDate(PATTERN_DATE_FORMAT.parse(endDate + " " + endTime + ":59"));
				advertise.setAdvStatus(advStatus);
				position.setAdvTarget(advTarget);
				content.setContents(contents.toString());
				if (StringUtils.countMatches(content.getContents(), "ImgName") == 4) {
					if (StringUtils.isBlank(advId)) {
						result = generateService.saveGenerateCombine(advertise, position, content);
					} else {
						result = generateService.updateGenerateCombine(advertise, position, content);
					}
				} else {
					result = false;
				}
				contents.setLength(0);
				// 存檔後立刻執行產生檔案的邏輯
				generateService.generateIdxMidBoxAdv_V3(null);
				if (!result) {
					if ("IDX_SALE_V3".equals(advType)) {
						return "editIdxPromotionAdv_V3";
					}
					return "editIdxPromotionAdv_V2";
				} else {
					advId = advertise.getId().toString();
					addActionMessage("储存成功");
					if ("IDX_SALE_V3".equals(advType)) {
						return editIdxPromotionAdv_V3();
					}
				}
			}
		}
		if ("IDX_SALE_V3".equals(advType)) {
			return "editIdxPromotionAdv_V3";
		}
		return "editIdxPromotionAdv_V2";
	}

	EventImage saveImgFile(File imgFile, String fileName, String advType) throws Exception {
		try {
			eventImage = new EventImage();
			eventImage.setImgType(fileName.substring(fileName.lastIndexOf("."), fileName.length()));
			eventImage = generateService.saveEventImage(eventImage);
			boolean result = GenerateHelper.uploadImage(eventImage, imgFile, advType);
			if (result) {
				return eventImage;
			} else {
				return null;
			}
		} catch (Exception e) {
			logger.info("exception :{}", e.getMessage());
		}
		return null;
	}

	public void setAdvertise(GenerateAdvertise advertise) {
		this.advertise = advertise;
	}

	public void setAdvId(String advId) {
		this.advId = advId;
	}

	public void setAdvName(String advName) {
		this.advName = advName;
	}

	public void setAdvStatus(String advStatus) {
		this.advStatus = advStatus;
	}

	public void setAdvTarget(String advTarget) {
		this.advTarget = advTarget;
	}

	public void setAdvType(String advType) {
		this.advType = advType;
	}

	public void setContent(GenerateContent content) {
		this.content = content;
	}

	public void setEndDate(String endDate) {
		this.endDate = endDate;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}

	public void setGenerateService(GenerateService generateService) {
		this.generateService = generateService;
	}

	public void setPosition(GeneratePosition position) {
		this.position = position;
	}

	public void setStartDate(String startDate) {
		this.startDate = startDate;
	}

	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}

	public void setTab1Img(File tab1Img) {
		this.tab1Img = tab1Img;
	}

	public void setTab1ImgFolder(String tab1ImgFolder) {
		this.tab1ImgFolder = tab1ImgFolder;
	}

	public void setTab1ImgLink(String tab1ImgLink) {
		this.tab1ImgLink = tab1ImgLink;
	}

	public void setTab1ImgName(String tab1ImgName) {
		this.tab1ImgName = tab1ImgName;
	}

	public void setTab1ProdId1(String tab1ProdId1) {
		this.tab1ProdId1 = tab1ProdId1;
	}

	public void setTab1ProdId2(String tab1ProdId2) {
		this.tab1ProdId2 = tab1ProdId2;
	}

	public void setTab1ProdId3(String tab1ProdId3) {
		this.tab1ProdId3 = tab1ProdId3;
	}

	public void setTab1ProdId4(String tab1ProdId4) {
		this.tab1ProdId4 = tab1ProdId4;
	}

	public void setTab1Title(String tab1Title) {
		this.tab1Title = tab1Title;
	}

	public void setTab2Img(File tab2Img) {
		this.tab2Img = tab2Img;
	}

	public void setTab2ImgFolder(String tab2ImgFolder) {
		this.tab2ImgFolder = tab2ImgFolder;
	}

	public void setTab2ImgLink(String tab2ImgLink) {
		this.tab2ImgLink = tab2ImgLink;
	}

	public void setTab2ImgName(String tab2ImgName) {
		this.tab2ImgName = tab2ImgName;
	}

	public void setTab2ProdId1(String tab2ProdId1) {
		this.tab2ProdId1 = tab2ProdId1;
	}

	public void setTab2ProdId2(String tab2ProdId2) {
		this.tab2ProdId2 = tab2ProdId2;
	}

	public void setTab2ProdId3(String tab2ProdId3) {
		this.tab2ProdId3 = tab2ProdId3;
	}

	public void setTab2ProdId4(String tab2ProdId4) {
		this.tab2ProdId4 = tab2ProdId4;
	}

	public void setTab2Title(String tab2Title) {
		this.tab2Title = tab2Title;
	}

	public void setTab3Img(File tab3Img) {
		this.tab3Img = tab3Img;
	}

	public void setTab3ImgFolder(String tab3ImgFolder) {
		this.tab3ImgFolder = tab3ImgFolder;
	}

	public void setTab3ImgLink(String tab3ImgLink) {
		this.tab3ImgLink = tab3ImgLink;
	}

	public void setTab3ImgName(String tab3ImgName) {
		this.tab3ImgName = tab3ImgName;
	}

	public void setTab3ProdId1(String tab3ProdId1) {
		this.tab3ProdId1 = tab3ProdId1;
	}

	public void setTab3ProdId2(String tab3ProdId2) {
		this.tab3ProdId2 = tab3ProdId2;
	}

	public void setTab3ProdId3(String tab3ProdId3) {
		this.tab3ProdId3 = tab3ProdId3;
	}

	public void setTab3ProdId4(String tab3ProdId4) {
		this.tab3ProdId4 = tab3ProdId4;
	}

	public void setTab3Title(String tab3Title) {
		this.tab3Title = tab3Title;
	}

	public void setTab4Img(File tab4Img) {
		this.tab4Img = tab4Img;
	}

	public void setTab4ImgFolder(String tab4ImgFolder) {
		this.tab4ImgFolder = tab4ImgFolder;
	}

	public void setTab4ImgLink(String tab4ImgLink) {
		this.tab4ImgLink = tab4ImgLink;
	}

	public void setTab4ImgName(String tab4ImgName) {
		this.tab4ImgName = tab4ImgName;
	}

	public void setTab4ProdId1(String tab4ProdId1) {
		this.tab4ProdId1 = tab4ProdId1;
	}

	public void setTab4ProdId2(String tab4ProdId2) {
		this.tab4ProdId2 = tab4ProdId2;
	}

	public void setTab4ProdId3(String tab4ProdId3) {
		this.tab4ProdId3 = tab4ProdId3;
	}

	public void setTab4ProdId4(String tab4ProdId4) {
		this.tab4ProdId4 = tab4ProdId4;
	}

	public void setTab4Title(String tab4Title) {
		this.tab4Title = tab4Title;
	}

	public String getTab1ImgadWord() {
		return tab1ImgadWord;
	}

	public void setTab1ImgadWord(String tab1ImgadWord) {
		this.tab1ImgadWord = tab1ImgadWord;
	}

	public String getTab2ImgadWord() {
		return tab2ImgadWord;
	}

	public void setTab2ImgadWord(String tab2ImgadWord) {
		this.tab2ImgadWord = tab2ImgadWord;
	}

	public String getTab3ImgadWord() {
		return tab3ImgadWord;
	}

	public void setTab3ImgadWord(String tab3ImgadWord) {
		this.tab3ImgadWord = tab3ImgadWord;
	}

	public String getTab4ImgadWord() {
		return tab4ImgadWord;
	}

	public void setTab4ImgadWord(String tab4ImgadWord) {
		this.tab4ImgadWord = tab4ImgadWord;
	}

	public String getTab1Prod1adWord() {
		return tab1Prod1adWord;
	}

	public void setTab1Prod1adWord(String tab1Prod1adWord) {
		this.tab1Prod1adWord = tab1Prod1adWord;
	}

	public String getTab1Prod2adWord() {
		return tab1Prod2adWord;
	}

	public void setTab1Prod2adWord(String tab1Prod2adWord) {
		this.tab1Prod2adWord = tab1Prod2adWord;
	}

	public String getTab1Prod3adWord() {
		return tab1Prod3adWord;
	}

	public void setTab1Prod3adWord(String tab1Prod3adWord) {
		this.tab1Prod3adWord = tab1Prod3adWord;
	}

	public String getTab2Prod1adWord() {
		return tab2Prod1adWord;
	}

	public void setTab2Prod1adWord(String tab2Prod1adWord) {
		this.tab2Prod1adWord = tab2Prod1adWord;
	}

	public String getTab2Prod2adWord() {
		return tab2Prod2adWord;
	}

	public void setTab2Prod2adWord(String tab2Prod2adWord) {
		this.tab2Prod2adWord = tab2Prod2adWord;
	}

	public String getTab2Prod3adWord() {
		return tab2Prod3adWord;
	}

	public void setTab2Prod3adWord(String tab2Prod3adWord) {
		this.tab2Prod3adWord = tab2Prod3adWord;
	}

	public String getTab3Prod1adWord() {
		return tab3Prod1adWord;
	}

	public void setTab3Prod1adWord(String tab3Prod1adWord) {
		this.tab3Prod1adWord = tab3Prod1adWord;
	}

	public String getTab3Prod2adWord() {
		return tab3Prod2adWord;
	}

	public void setTab3Prod2adWord(String tab3Prod2adWord) {
		this.tab3Prod2adWord = tab3Prod2adWord;
	}

	public String getTab3Prod3adWord() {
		return tab3Prod3adWord;
	}

	public void setTab3Prod3adWord(String tab3Prod3adWord) {
		this.tab3Prod3adWord = tab3Prod3adWord;
	}

	public String getTab4Prod1adWord() {
		return tab4Prod1adWord;
	}

	public void setTab4Prod1adWord(String tab4Prod1adWord) {
		this.tab4Prod1adWord = tab4Prod1adWord;
	}

	public String getTab4Prod2adWord() {
		return tab4Prod2adWord;
	}

	public void setTab4Prod2adWord(String tab4Prod2adWord) {
		this.tab4Prod2adWord = tab4Prod2adWord;
	}

	public String getTab4Prod3adWord() {
		return tab4Prod3adWord;
	}

	public void setTab4Prod3adWord(String tab4Prod3adWord) {
		this.tab4Prod3adWord = tab4Prod3adWord;
	}

}